package com.mz.mattress.api.mattress;

import lombok.Data;

import java.io.Serializable;

@Data
public class MattressResp<T> implements Serializable {

    private static final long serialVersionUID = 1L;

    public static final MattressResp FAIL = new MattressResp();

    //状态码 200
    private Integer statusCode;

    private Boolean succeeded;

    //返回的消息，code!=0时，失败原因
    private String errors;

    //返回的数据
    private T data;

    private String timestamp;

    public Boolean isFailed() {
        return statusCode != 200;
    }

    public Boolean isSuccess() {
        return statusCode == 200;
    }

}
